package com.kyivmohyla.kma2.client.view.engineer;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.datepicker.client.DatePicker;
import com.google.inject.Inject;
import com.kyivmohyla.kma2.client.presenter.engineer.EngineerMainViewPresenter;
import com.kyivmohyla.kma2.client.view.common.OrderCellTableWidget;

public class EngineerMainView extends Composite implements EngineerMainViewPresenter.Display {
    private static EngineerMainViewUiBinder ourUiBinder = GWT.create(EngineerMainViewUiBinder.class);
    @UiField
    protected DatePicker datePicker;
    @UiField
    protected OrderCellTableWidget orderCellTable;
    @UiField
    protected Button exportOrders;

    @Inject
    public EngineerMainView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public HasValueChangeHandlers getDatePicker() {
        return datePicker;
    }

    @Override
    public OrderCellTableWidget getOrderCellTable() {
        return orderCellTable;
    }

    @Override
    public HasClickHandlers getExportOrdersButton() {
        return exportOrders;
    }

    public Widget asWidget() {
        return this;
    }

    interface EngineerMainViewUiBinder extends UiBinder<Widget, EngineerMainView> {
    }
}